package com.itheima.service.impl;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import com.itheima.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User> selectByPage(int currentPage, int pageSize) {
       return userMapper.selectByPage(currentPage,pageSize);
    }

    @Override
    public Integer selectTotalCount() {
        return userMapper.selectTotalCount();
    }

    @Override
    public int add(User user) {
        return userMapper.add(user);
    }

    @Override
    public int deleteById(Integer id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int update(User user) {
        return userMapper.update(user);
    }
}
